//Handler.java
package responsibilityChain;

/**
 *@author:youtubezou
 *@version:2012-8-5
 */
public abstract class Handler
{
	private static int count = 0;
	protected int id = ++count;
	protected Handler successor;
	

	public abstract void handleRequest();

	public Handler getSuccessor()
	{
		return successor;
	}

	public Handler setSuccessor(Handler successor)
	{
		this.successor = successor;
		
		return this;
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}
}
